package cn.highset.modules.base.controller.api;

import cn.highset.base.ApiBaseController;
import cn.highset.common.annotation.IgnoreAuth;
import cn.highset.common.constant.ContentKey;
import cn.highset.common.utils.ResultUtil;
import cn.highset.common.vo.Result;
import cn.highset.modules.base.service.ContentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类 描 述：API 富文本内容
 * 创建时间：2019-06-15 10:32
 * 创 建 人：victor
 */
@Slf4j
@RestController
@Api(description = "API富文本内容")
@RequestMapping("/api/content")
@Transactional
public class ApiContentController extends ApiBaseController {

    @Autowired
    private ContentService contentService;

    @IgnoreAuth
    @RequestMapping(value = "/getTrafficCn", method = RequestMethod.POST)
    @ApiOperation(value = "获取交通指南中文")
    public Result<Object> getTrafficCn() {
        return new ResultUtil<Object>().setData(contentService.findByType(ContentKey.TRAFFIC_CN));
    }

    @IgnoreAuth
    @RequestMapping(value = "/getExhibitionOutlineCn", method = RequestMethod.POST)
    @ApiOperation(value = "获取展会概要中文")
    public Result<Object> getExhibitionOutlineCn() {
        return new ResultUtil<Object>().setData(contentService.findByType(ContentKey.EXHIBITION_OUTLINE_CN));
    }

    @IgnoreAuth
    @RequestMapping(value = "/getExhibitionOutlineEn", method = RequestMethod.POST)
    @ApiOperation(value = "获取展会概要英文")
    public Result<Object> getExhibitionOutlinen() {
        return new ResultUtil<Object>().setData(contentService.findByType(ContentKey.EXHIBITION_OUTLINE_EN));
    }

    @IgnoreAuth
    @RequestMapping(value = "/getContactUsCn", method = RequestMethod.POST)
    @ApiOperation(value = "获取联系我们中文")
    public Result<Object> getContactUsCn() {
        return new ResultUtil<Object>().setData(contentService.findByType(ContentKey.CONTACT_US_CN));
    }

    @IgnoreAuth
    @RequestMapping(value = "/getContactUsEn", method = RequestMethod.POST)
    @ApiOperation(value = "获取联系我们英文")
    public Result<Object> getContactUsEn() {
        return new ResultUtil<Object>().setData(contentService.findByType(ContentKey.CONTACT_US_EN));
    }

    @IgnoreAuth
    @RequestMapping(value = "/getStandCn", method = RequestMethod.POST)
    @ApiOperation(value = "获取展位图描述中文")
    public Result<Object> getStandCn() {
        return new ResultUtil<Object>().setData(contentService.findByType(ContentKey.STAND_CN));
    }


}
